package com.qqtech.qquan.sys.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.qqtech.core.frame.dao.BaseDaoImpl;
import com.qqtech.qquan.sys.model.SysFunction;
import com.qqtech.qquan.sys.model.SysFunctionQuery;
import com.qqtech.qquan.sys.model.SysFunctionVo;

@Repository
public class SysFunctionDaoImpl extends BaseDaoImpl<SysFunction> implements SysFunctionDao {
	public static final Logger log = LoggerFactory.getLogger(SysFunctionDaoImpl.class);

	@Override
	public List<SysFunctionVo> queryListByParentId(SysFunctionQuery sysFunction) {
		return sqlSessionTemplate.selectList(getSqlName("selectByParentId"), sysFunction);
	}

	@Override
	public Integer getMaxOrderIdx() {
		return (Integer) sqlSessionTemplate.selectOne(getSqlName("getMaxOrderIdx"));
	}

	@Override
	public List<SysFunctionVo> getChildrenForRole(SysFunctionQuery sysFunction) {
		return sqlSessionTemplate.selectList(getSqlName("getChildrenForRole"), sysFunction);
	}

	@Override
	public List<SysFunctionVo> getByRoleId(SysFunctionQuery sysFunction) {
		return sqlSessionTemplate.selectList(getSqlName("getByRoleId"), sysFunction);
	}
	
}
